<!-- 模板 -->
<template>
  <div class="">
    <!-- 登录表单 -->
    <el-form :inline="true" :model="userInfo" ref="loginFormRef">
      <el-form-item label="用户名">
        <el-input v-model="userInfo.username" placeholder="输入用户名" type="text"></el-input>
      </el-form-item>
      <el-form-item label="密码">
        <el-input v-model="userInfo.password" placeholder="输入密码" type="password"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">登录</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'Login',
  data() {
    return {
      userInfo: {
        username: '',
        password: ''
      }
    }
  },
  methods: {
    //登录的函数
    onSubmit() {
      //获得表单
      console.log(this.$refs.loginFormRef)
    }
  }
}
</script>

<style lang="less" scoped></style>
